<template>
	<div class="two">
	    <h1 ref="t">Two</h1>
		<Comc ref="c"></Comc>
		<Comd @click.native="show"></Comd>
	</div>
</template>


<script>
import Comc from "@/components/Comc.vue";
import Comd from "@/components/Comd.vue";

export default {
  name: 'Two',
  data(){
	  return{
		 Parentmsg:"我是祖先Two",
		 obj:{
			 name:"姚钱树",
			 age:33
		 }
	  }
  },
  methods:{
	  showParent(){
		  console.log("parent");
	  },
	  show(){
		  alert("1111");
	  }
  },
  components:{
	Comc, 
	Comd
  },
  provide(){//祖先
	  return{
		 Parentmsg:this.Parentmsg,
		 obj:this.obj
	  }
  },
  mounted(){
	  console.log(this.$children);
	  console.log(this.$root.num);
	  console.log(this.$refs.t);
	  console.log(this.$refs.c);
  }
}
</script>

<style>
</style>